/**
 * 
 */
package x10.log;

import java.util.logging.Level;

/**
 * Sub-class of the java.util.logging.Level to provide a custom
 * logger label named X10Event, for logging x10 events to the
 * event log.
 * 
 * @author Denny Sheirer
 * @date   2011
 */
public class CustomLevel extends Level {

    static final long serialVersionUID = 1L;
    public static final Level EVENT = new CustomLevel("EVENT", Level.FINER.intValue());
    public static final Level RAW = new CustomLevel("RAW", Level.FINEST.intValue());

    public CustomLevel(String name, int value){
	super(name, value);
    }

    public static Level parse(String level){
	if(level.contentEquals("EVENT")){
	    return (Level)CustomLevel.EVENT;
	} else if (level.contentEquals("RAW")){
	    return (Level)CustomLevel.RAW;
	} else {
	    return Level.parse(level);
	}
    }
}

